<?php
	include "admin/lib/config.inc.php";
	
	$sql ="SELECT * FROM `albuns`, `imagens_album` WHERE `albuns`.`id_album` LIKE `imagens_album`.`album_id` and foto_pos LIKE '0' ORDER BY foto_data DESC LIMIT 4";
	
	$result = mysql_query($sql);
	while($row = mysql_fetch_array($result)){ 
	
		$id_album = $row['id_album'];
		$nome_album = $row['nome_album'];
		$caminho_imagem = "admin/p_galeria/img/".$row['foto_url'];
		$nome_imagem = $row['foto_url'];
		$idFoto = $row['foto_id']; 
		
		?>
		
		<?php // index.php?pg=galeria&i= echo $id_album; ?>
		<div class="col-md-3" align="center" >
			<div>
				<a href="<?php echo $caminho_imagem; ?>" data-lightbox="roadtrip" data-title="Exemplo">
            		<img  style="width:250px;height:150px;overflow:hidden;" width ="150px" class="img-responsive img-portfolio img-hover" src="<?php echo $caminho_imagem;?>" alt="">
				</a>
			</div>
			<div>
				<a href="#" onclick="location.href='albuns.php?i=<?php echo $id_album;?>'"class="btn btn-info btn-xs">Ver Album</a>
			</div>
		</div>
		
<?php 
//;
	}
